Execution path determination in a distributed environment

ABSTRACT

Techniques to determine an execution path in a distributed environment are disclosed. A call to a method or function of a component of the distributed system is received, in connection with a request from a user of the distributed system. A unique correlation identifier that includes data that identifies the component, the request, and the method of function called is generated for the call.

BACKGROUND OF THE INVENTION

In a typical distributed system it can be difficult to determine the execution path of a request. It becomes much harder to do so when multiple and/or different products or other components can be inserted into the execution path, for example via plug-ins or other configurations based on customer requirements. Product support engineers typically have to understand the complete deployment topology to understand the request flow.

BRIEF DESCRIPTION OF THE DRAWINGS

Various embodiments of the invention are disclosed in the following detailed description and the accompanying drawings.

FIG. 1 is a block diagram illustrating an embodiment of a distributed system.

FIG. 2 is a flow chart illustrating an embodiment of a process of processing requests in a distributed system.

FIG. 3 is a flow chart illustrating an embodiment of a process of processing a function call in a distributed system.

FIG. 4 is a flow chart illustrating an embodiment of a process of processing a function call from a calling source external to a called library.

FIG. 5 is a flow chart illustrating an embodiment of a process of processing a function call from a calling source external to a called component.

FIG. 6 is a block diagram illustrating an example of a sequence of method calls in an embodiment of a distributed system.

DETAILED DESCRIPTION

The invention can be implemented in numerous ways, including as a process; an apparatus; a system; a composition of matter; a computer program product embodied on a computer readable storage medium; and/or a processor, such as a processor configured to execute instructions stored on and/or provided by a memory coupled to the processor. In this specification, these implementations, or any other form that the invention may take, may be referred to as techniques. In general, the order of the steps of disclosed processes may be altered within the scope of the invention. Unless stated otherwise, a component such as a processor or a memory described as being configured to perform a task may be implemented as a general component that is temporarily configured to perform the task at a given time or a specific component that is manufactured to perform the task. As used herein, the term ‘processor’ refers to one or more devices, circuits, and/or processing cores configured to process data, such as computer program instructions.

A detailed description of one or more embodiments of the invention is provided below along with accompanying figures that illustrate the principles of the invention. The invention is described in connection with such embodiments, but the invention is not limited to any embodiment. The scope of the invention is limited only by the claims and the invention encompasses numerous alternatives, modifications and equivalents. Numerous specific details are set forth in the following description in order to provide a thorough understanding of the invention. These details are provided for the purpose of example and the invention may be practiced according to the claims without some or all of these specific details. For the purpose of clarity, technical material that is known in the technical fields related to the invention has not been described in detail so that the invention is not unnecessarily obscured.

Generating and storing a unique correlation identifier for a method/function call in a distributed environment, for example to facilitate execution path determination, is disclosed. In various embodiments, each product/component and each function call within each product/component is identified by a unique identifier. In some embodiments, each product/component in the distributed environment defines its unique identity in a distributed system, and is configured to generate and store for each function (or other method) call a unique identifier.

FIG. 1 is a block diagram illustrating an embodiment of a distributed system. In the example shown, the distributed system 100 includes a plurality of client systems, represented in FIG. 1 by clients 102, 104, and 106, connected via the Internet 108 to a plurality of servers, represented in FIG. 1 by servers 110, 112, and 114. We may also add few second tier servers as well. For example Server 1 may call to Server 2 or directly server the client request. The client systems 102, 104, and 106 may be desktop or laptop computers, mobile smart phones or other mobile devices, or any system that includes a processor, a memory or other storage device, and a communication interface to communicate via a network such as Internet 108. We may include more generic example without mentioning content server client or server. The servers 110, 112, and 114 may be separate physical systems or one or more servers may run on a single physical system. The distribute system 100 in some embodiments may include on servers such as 110, 112, and 114 one or more functionally distinct components of an application and/or service provided via distributed system 100. For example, the distributed system 100 may provide to clients such as clients 102, 104, and 106, access to an application or service that includes one or more base applications and in addition one or more “plug ins” or other additions to and/or customizations of the base application(s) and/or service(s). In some cases, a distributed system may include numerous applications or functional modules thereof and/or multiple plug ins, arranged in one of potentially a plurality of possible configurations. In such a system, without using techniques disclosed herein the execution path of function and/or other calls associated with an underlying request, for example a user request from a client such as 102, 104, or 106, can be challenging or in some cases nearly impossible to determine, for example as functions calls are made across libraries and/or between components residing on one or more servers, such as servers 110, 112, and 114.

FIG. 2 is a flow chart illustrating an embodiment of a process of processing requests in a distributed system. In the example shown, when a new request is received (202), a unique request identifier is generated for the request (204). A “request” in this context may be received at a component of a distributed system from a client, such as clients 102, 104, or 106 of FIG. 1. The request may require one or more function calls to be made by and/or between components of the distributed system, for example to obtain or verify credentials and/or internal information, to access content required to be provided and/or manipulated in response to the request, and/or to update state information to reflect the request and/or operations performed in response to the request. The generated request identifier (204) is stored in a manner that associates the request identifier with a runtime context with which the request is associated (206), for example, a session or other state information associated with a client from which the request was received, etc. In some embodiments, the request identifier comprises a counter, for example a request identifier having a value n would indicate that the request is the nth request received by that component. A method required to be performed by the component that received the request is determined, for example based on information included in the request (e.g., function or operation called), and an associated method identifier and method counter data are determined (208). The method identifier uniquely identifies the method within the component that received the request. In some embodiments, the method identifier may include a function name. The method counter reflects how many methods have been called in connection with the current request. A unique correlation identifier is generated, for example using one or more of the request identifier, the method identifier, and the method count, and stored (210). In some embodiments, the unique correlation identifier includes an identifier of the product or other component that received the request.

The following is an example of a correlation identifier format as implemented in some embodiments:

Correlation id=<Product id: request counter: method call counter: method name>

Example: 200.2.1.foo

Means this correlation id was generated as a result of:

2^(nd) request to product with product id 200

Called “foo” function, which is the 1^(st) method call after the request enter into product 200

FIG. 3 is a flow chart illustrating an embodiment of a process of processing a function call in a distributed system. In the example shown, when a function call is made (302) to a function associated with a different product/component (304), the calling product/component serializes at least a portion of its latest correlation identifier and includes the serialized data as part of a remote procedure call (RPC) to the callee (306). If the call is made to a function within the same product or component (304) but in a different library than the most recently called function (308) the latest correlation identifier is passed to the called library (310). If the call is made to a different function within the same product/component and library (304, 308), the method identifier is determined (in some embodiments, omitted if already known, e.g., the method or function name is used as the identifier) and the method counter is incremented (312), and a unique correlation identifier is generated and stored (314).

The following is an example of a correlation identifier format, as implemented in some embodiments, for example when a call is made to another product or component comprising the distributed system, as in 306 of FIG. 3:

Correlation id=<Product id: request counter: method call counter: method name>

Example: 200.2.1.foo.300.1.1.bar

Means this correlation id was generated as a result of

-   -   2^(nd) request to product with product id 200     -   Called “foo” function, which is the 1^(st) method call after the         request enter into product 200     -   Product 200 makes a call to product with product id 300     -   It is the 1^(st) request to product with id 300     -   Product with id 300 Called “bar” function, which is the 1^(st)         method call after the request enter into product with id 300

FIG. 4 is a flow chart illustrating an embodiment of a process of processing a function call from a calling source external to a called library. In the example shown, when a call is made in to a function of a library for the first time (for a given request) (402), the calling product/component's latest correlation identifier is received (404) and used to generate for the call a correlation identifier that includes the caller correlation identifier received from the caller and also a portion generated for the call to the called function (406), resulting in some embodiments in a combined correlation identifier as in the example described above for a call between products/components.

FIG. 5 is a flow chart illustrating an embodiment of a process of processing a function call from a calling source external to a called component. In the example shown, a call is received from another product/component in the same distributed system (502). The call data is deserialized and a calling product/component correlation identifier included in the call data by the calling party is extracted (504). A local correlation identifier information is determined for the call, e.g., a method identifier associated with the called function is determined and local method counter is initialized to an initial value of “1” (506). The extracted calling party correlation identifier and generated local correlation identifier information are used to generate a final correlation identifier (508), as in the example described above (i.e., 200.2.1.foo.300.1.1.bar).

FIG. 6 is a block diagram illustrating an example of a sequence of method calls in an embodiment of a distributed system. In the example shown, the sequence of calls 600 includes a first request to a method “M1” of a product/component “P1”, resulting in a correlation identifier of Id=200.1.1.m1 being generated. In this example “200” is the product/component identifier; the first “1” identifies the call as being associated with the request “1”; the second “1” indicates this is the first method called in connection with this request; and “m1” identifies the method called. If response to the request, a second method, M2, of the same product P1 is called. The correlation identifier Id=200.1.2.m2 is generated, identifying the call as one to product P1 (product id=200) in connection with request=1, second method call this request, to method M2 (method id=m2). Next, a third method M3 within product P1 is called, resulting in correlation identifier Id=200.1.3.m3. Next, a method M1 in product P2 (product id=300), resulting in correlation identifier Id=200.1.3.m3.300.1.1.m1; i.e., call from product P1, where the last call was the third method called for request 1, to method M3, and the call was in to product P2 (id=300), to method M1 of P2, the first method called this product P2 for request 1. In the lower sequence, a second request (request id=2) is received by product P1, but in to method M2 in this case, resulting in correlation identifier Id=200.2.1.m2 (called product P1, second request, first method call this request, made to method M2). Continuing the lower sequence, a call to method M1 of product P2 would result in an inter-product correlation identifier Id=200.2.1.m2.300.1.m1.

While specific correlation identifier formats and contents are described in connection with some embodiments, in other embodiments other and/or different information may be included and/or represented in other and/or different ways. In various embodiments, correlation identifiers generated as described herein may be logged and/or otherwise reported and/or stored. Such identifiers may be used, in various embodiments, to troubleshoot or otherwise analyze system performance, for example and without limitation to track back a sequence of calls to determine the source of an error or other problem and/or to detect and localize bottlenecks or other performance issues. In some embodiments, such analysis is or may be at least partly automated. The correlation identifiers are parsed programmatically to generate a map, listing, or other representation of the sequence of calls associated with a request. In some embodiments, data associated with a request and its processing may be generated and stored in a manner such that the correlation identifier(s) generated and stored as described herein may be used to retrieve such associated information.

Although the foregoing embodiments have been described in some detail for purposes of clarity of understanding, the invention is not limited to the details provided. There are many alternative ways of implementing the invention. The disclosed embodiments are illustrative and not restrictive. 

What is claimed is:
 1. A method of processing a request in a distributed system, comprising: receiving, by one or more processors associated with a first component of the distributed system, in connection with a request from a user of the distributed system, a first call to a method or function of the first component; generating, by the one or more processors associated with the first component of the distributed system, a unique correlation identifier for the first call, the unique correlation identifier comprising data that identifies: the first component associated with the request, a request counter identifier that identifies the request in relation to another request received by the distributed system, a method counter identifier indicating a sequential place of the first call within a sequence of calls associated with the request, and an identifier of a method of the first component or a function of the first component that is called; and providing, by the one or more processors associated with the first component of the distributed system, the unique correlation identifier to a second component, wherein the unique correlation identifier is provided to the second component of the distributed system in connection with a second call by the first component to the second component in connection with the request from the user, wherein the first component corresponds to one of a plurality of components of the distributed system.
 2. The method of claim 1, wherein the distributed system comprises a plurality of products integrated to provide the distributed system and the first component includes one or more of the products.
 3. The method of claim 1, further comprising storing the unique correlation identifier.
 4. The method of claim 1, further comprising providing the unique correlation identifier as output.
 5. The method of claim 1, further comprising using the unique correlation identifier to analyze a failure associated with the request.
 6. The method of claim 1, further comprising using the unique correlation identifier to analyze a system performance issue associated with the request.
 7. The method of claim 1, further comprising parsing the unique correlation identifier to determine at least in part programmatically an execution path or portion thereof associated with the request.
 8. The method of claim 1, wherein the second call is received from another component of the distributed system.
 9. The method of claim 8, wherein receiving the second call includes receiving in connection with the second call a latest correlation identifier of the component from which the second call is received.
 10. The method of claim 9, further comprising using the latest correlation identifier of the component from which the second call is received to generate the unique correlation identifier for the second call.
 11. The method of claim 9, further comprising including at least a portion of the latest correlation identifier of the component from which the second call is received in the unique correlation identifier for the second call.
 12. The method of claim 1, wherein the first call is received from a calling method or function of the first component but external to a called library with which the called method or function is associated.
 13. The method of claim 12, wherein receiving the first call includes receiving in connection with the first call a calling party correlation identifier associated with the first call into the calling method or function.
 14. The method of claim 1, wherein the request counter identifier corresponds to an integer n, which indicates that the request received at the first component corresponds to an nth request received by the first component.
 15. The method of claim 1, wherein in the event that the second call is made to a function within the same product or component but in a different library than a most recently called function, the latest correlation identifier is passed to the called library.
 16. The method of claim 1, wherein in the event that the second call is made to a different function within the same product or component and within the same library, the method counter identifier is incremented.
 17. The method of claim 1, wherein the unique identifier for the first call to the method or function of the first component is serialized with additional information to form an inter-product correlation identifier, such additional information identifying: the second component to which the second call is made by the first component, a method of the second component subject to the second call made by the first component, and a method counter identifier that identifies the method associated with the second component that is called in connection with the request in relation to other methods of the second component called in connection with the request.
 18. The method of claim 1, wherein the unique correlation identifier is associated with a runtime context with which the request is associated.
 19. The method of claim 1, wherein the request identifier further identifies the request in relation to another request for the first component received.
 20. The method of claim 1, further comprising: receiving, at the second component, the unique correlation identifier in connection with the second call from the first component; determining a local correlation identifier in connection with a third call to be made by the second component to a third component of the plurality of components in the distributed system; and generating a combined correlation identifier, wherein the combined correlation identifier includes the local correlation identifier and at least a part of the unique correlation identifier.
 21. The method of claim 20, wherein the generating the combined correlation identifier comprises serializing the local correlation identifier with the unique correlation identifier.
 22. The method of claim 1, wherein the unique correlation identifier is stored in a manner that associates the unique correlation identifier with a runtime context with which the unique correlation identifier is associated.
 23. The method of claim 1, wherein the identifier of the method of the first component or the function of the first component that is called comprises the name of the method or the function.
 24. A distributed system, comprising: a processor configured to: receive at a first component of the distributed system, in connection with a request from a user of the distributed system, a first call to a method or function of the first component; generate for the first call a unique correlation identifier that includes data that identifies the first component associated with the request, a request counter identifier that identifies the request in relation to another request received by the distributed system, a method counter identifier indicating a sequential place of the first call within a sequence of calls associated with the request, and a method of the first component or a function of the first component that is called; and provide the unique correlation identifier to a second component, wherein the unique correlation identifier is provided to the second component of the distributed system in connection with a second call by the first component to the second component in connection with the request from the user; and a memory or other storage device coupled to the processor and configured to store the unique correlation identifier; wherein the first component corresponds to one of a plurality of components of the distributed system.
 25. The distributed system of claim 24, further comprising a plurality of products integrated to provide the distributed system and the first component includes one or more of the products.
 26. The distributed system of claim 24, wherein the second call is received from another component of the distributed system; and wherein the processor is further configured to receive in connection with the second call a latest correlation identifier of the component from which the second call is received.
 27. The distributed system of claim 26, wherein the processor is further configured to use the latest correlation identifier of the component from which the second call is received to generate the unique correlation identifier for the second call.
 28. A computer program product embodied in a tangible, non-transitory computer readable storage medium and comprising computer instructions for: receiving, by one or more processors associated with a first component of a distributed system, in connection with a request from a user of the distributed system, a first call to a method or function of the first component; generating, by the one or more processors associated with the first component of the distributed system, a unique correlation identifier for the first call, the unique correlation identifier comprising data that identifies the first component associated with the request, a request counter identifier that identifies the request in relation to another request received by the distributed system, a method counter identifier indicating a sequential place of the first call within a sequence of calls associated with the request, and a method of the first component or a function of the first component that is called; and providing, by the one or more processors associated with the first component of the distributed system, the unique correlation identifier to a second component, wherein the unique correlation identifier is provided to the second component of the distributed system in connection with a second call by the first component to the second component in connection with the request from the user, wherein the first component corresponds to one of a plurality of components of the distributed system. 